<template>
  <div class="reportFormPage">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">土承载比（CBR）含水率试验检测记录表</div>
        <div class="codeText">
          <tr>
            JGLQ010083
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span class="placeholder">{{ form.jilbh }}</span>
        </div>
      </div>
      <div class="table-border">
        <!-- .........................1111111111111111111111111111111......................................................... -->
        <table height="220px" class="top-table" align="center">
          <tbody>
          <tr>
            <td height="30" align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程名称</span>
            </td>
            <td width="35%" class="text-center">
              <span>{{ form.gongcmc }}</span>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">工程部位/用途</span>
            </td>
            <td width="35%" class="text-center">
              <span>{{ form.gongcbwyt }}</span>
            </td>
          </tr>
          <tr>
            <td height="50" align="center">样品信息</td>
            <td class="specimen-border" colspan="3">
              <span>样品名称：</span>
              <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
              <span>；样品编号：</span>
              <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>

              <span>；样品数量：</span>
              <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
              <span>；样品状态：</span>
              <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
              <span>；来样时间：</span>
              <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
            </td>
          </tr>

          <tr>
            <td height="25" align="center" width="15%">
              <span style="width: 90px; display: inline-block">试验检测日期</span>
            </td>
            <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->
            <td width="35%" class="text-center">
              <el-input v-model="form.shiyjcrq"/>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">试验条件</span>
            </td>
            <td v-if="isPdf" width="35%">
              温度：
              <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
              ℃；湿度：
              <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span>%RH
            </td>
            <td v-else width="35%">
              温度：
              <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" class="height100"
                        style="width: 15%"/>
              ℃；湿度：
              <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" class="height100"
                        style="width: 15%"/>
              %RH
            </td>
          </tr>

          <tr>
            <td height="50" align="center" width="15%">
              <span style="width: 90px; display: inline-block">检测依据</span>
            </td>
            <td width="35%">
              <span v-if="isPdf">{{ form.jiancyj }}</span>
              <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark"
                        @dblclick.native="showBsJiancyjView" readonly/>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">判定依据</span>
            </td>
            <td width="35%">
              <span v-if="isPdf">{{ form.pandyj }}</span>
              <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView"
                        @focus="handleFocus('pandyj')" class="mark"/>
            </td>
          </tr>
          <tr class="bottom-border">
            <td height="50" align="center">
              <div>主要仪器设备</div>
              <div>名称及编号</div>
            </td>
            <td colspan="3">
              <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark"
                        @dblclick.native="showBsInstrumentView" readonly></el-input>
            </td>
          </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="616px" class="middle-table">
          <tbody>
          <tr trindex="0">
            <td colspan="4" class="td2">
              最大干密度(g/cm3)
            </td>
            <td colspan="5" class="td3">
              <el-input v-model="form.zuidgmd" @change="setTgCBRzdgmdPjz"/>
            </td>
            <td colspan="4" class="td2">
              最佳含水率(%)
            </td>
            <td colspan="5" class="td2">
              <el-input v-model="form.zuijhsl" @change="setTgCBRzdgmdPjz"/>
            </td>
          </tr>
          <tr trindex="1">
            <td colspan="18" height="25">含水率</td>
          </tr>
          <!--第一组-->
          <tr trindex="2">
            <td rowspan="7" colspan="1" class="td1">一组</td>
            <td rowspan="1" colspan="1" class="td1">试验次数</td>
            <td rowspan="1" colspan="2" class="td2">盒号</td>
            <td rowspan="1" colspan="2" class="td2">盒质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+湿土质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">水分质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">含水率(%)</td>
          </tr>
          <tr trindex="3" v-if="index <= 5" v-for="(item, index) in form.baDetailVos" :key="index">
            <td rowspan="2" colspan="1" class="td1" v-if="index % 2 == 0">{{ index / 2 + 1 }}</td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input :type="isPdf ? 'string' : 'string'" v-model="item.heh" class="pointer mark"
                        @dblclick.native="showBaQjDetailView(index)" readonly/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hezl" @keydown.native="handleKeyDown($event, index, 0)" :ref="`${index}_0`"
                        @paste.native="handlePaste($event, index, 0)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejstzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 1)" :ref="`${index}_1`"
                        @paste.native="handlePaste($event, index, 1)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejgtzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 2)" :ref="`${index}_2`"
                        @paste.native="handlePaste($event, index, 2)"/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.gantzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.shifzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hansl" disabled/>
            </td>
          </tr>
          <!--第二组-->
          <tr trindex="9">
            <td rowspan="7" class="td1">二组</td>
            <td rowspan="1" colspan="1" class="td1">试验次数</td>
            <td rowspan="1" colspan="2" class="td2">盒号</td>
            <td rowspan="1" colspan="2" class="td2">盒质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+湿土质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">水分质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">含水率(%)</td>
          </tr>
          <tr trindex="3" v-if="index >= 6 && index <= 11" v-for="(item, index) in form.baDetailVos" :key="index">
            <td rowspan="2" colspan="1" class="td1" v-if="index % 2 == 0">{{ index / 2 + 1 }}</td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input :type="isPdf ? 'string' : 'string'" v-model="item.heh" class="pointer mark"
                        @dblclick.native="showBaQjDetailView(index)" readonly/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hezl" @keydown.native="handleKeyDown($event, index, 0)" :ref="`${index}_0`"
                        @paste.native="handlePaste($event, index, 0)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejstzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 1)" :ref="`${index}_1`"
                        @paste.native="handlePaste($event, index, 1)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejgtzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 2)" :ref="`${index}_2`"
                        @paste.native="handlePaste($event, index, 2)"/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.gantzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.shifzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hansl" disabled/>
            </td>
          </tr>
          <!--第三组-->
          <tr trindex="16">
            <td rowspan="7" class="td1">三组</td>
            <td rowspan="1" colspan="1" class="td1">试验次数</td>
            <td rowspan="1" colspan="2" class="td2">盒号</td>
            <td rowspan="1" colspan="2" class="td2">盒质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+湿土质量(g)</td>
            <td rowspan="1" colspan="3" class="td3">盒+干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">干土质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">水分质量(g)</td>
            <td rowspan="1" colspan="2" class="td2">含水率(%)</td>
          </tr>
          <tr trindex="3" v-if="index >= 12 && index <= 17" v-for="(item, index) in form.baDetailVos" :key="index">
            <td rowspan="2" colspan="1" class="td1" v-if="index % 2 == 0">{{ index / 2 + 1 }}</td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input :type="isPdf ? 'string' : 'string'" v-model="item.heh" class="pointer mark"
                        @dblclick.native="showBaQjDetailView(index)" readonly/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hezl" @keydown.native="handleKeyDown($event, index, 0)" :ref="`${index}_0`"
                        @paste.native="handlePaste($event, index, 0)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejstzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 1)" :ref="`${index}_1`"
                        @paste.native="handlePaste($event, index, 1)"/>
            </td>
            <td rowspan="1" colspan="3" class="td3">
              <el-input v-model="item.hejgtzl" @change="calculateHansl(index)"
                        @keydown.native="handleKeyDown($event, index, 2)" :ref="`${index}_2`"
                        @paste.native="handlePaste($event, index, 2)"/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.gantzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.shifzl" disabled/>
            </td>
            <td rowspan="1" colspan="2" class="td2">
              <el-input v-model="item.hansl" disabled/>
            </td>
          </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')"/>
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
        <tr>
          <td width="10%" align="right">检测：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">记录：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">复核：</td>
          <td align="left" width="15%"></td>
          <td width="10%">日期：</td>
          <td align="left" width="15%">
            <div style="display: inline-block; margin-left: 20px">年</div>
            <div style="display: inline-block; margin-left: 20px">月</div>
            <div style="display: inline-block; margin-left: 20px">日</div>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <ba-qj-detail-view ref="baQjDetailViewRef" :excelId="excelId" :shiyjcrq="form.shiyjcrq"
                       @select="selectBaQjDetail"></ba-qj-detail-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import {handleFocus, emptyConvert, handleKeyDown, handlePaste, calculateMeanvalue} from "@/views/reportForms/utils";
import {
  getTgTdczbhslBsInfo
} from "@/api/report_tg/tgTdczbhslBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

import decimal from "@/utils/big-decimal";
import Bus from "@/utils/bus";

export default {
  name: "tdczbhsl",
  components: {
    BsInstrumentView,
    BaQjDetailView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },

  data() {
    return {
      // 表单参数
      form: {
        baDetailVos: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = {...emptyConvert(this.form, newVal)};
    }
  },
  created() {
    this.getInfo();
  },
  mounted() {
    // 击实最大含水率
    Bus.$on("setTgJszdgmdPjz", (data) => {
      const {zdgmdPjz, zjhslPjz} = data;
      if (zdgmdPjz) {
        this.form.zuidgmd = zdgmdPjz;
      }
      if (zjhslPjz) {
        this.form.zuijhsl = zjhslPjz;
      }
      this.setTgCBRzdgmdPjz();
    });
  },
  beforeDestroy() {
    // 停止监听事件
    Bus.$off("setTgJszdgmdPjz");
  },
  methods: {
    // 获取详情
    getInfo() {
      getTgTdczbhslBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setTgBgJiancyj", {jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds});
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
      this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setTgBgZhuyyqsbmcjbh", {zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds});
    },
    // 显示盒号列表
    showBaQjDetailView(type, label) {
      this.label = label;
      if (label !== "tong") {
        this.collectHehId();
      }
      this.$refs.baQjDetailViewRef.init(type, this.form.hehIdList);
    },
    // 盒号选择
    selectBaQjDetail(type, obj) {
      this.form.baDetailVos[type][this.label == "tong" ? "tongh" : "heh"] = obj.hh;
      this.form.baDetailVos[type][this.label == "tong" ? "tongzl" : "hezl"] = obj.quality;
      if (this.label != "tong") {
        this.form.baDetailVos[type]["hehId"] = obj.detailId;
      } else {
        this.form.baDetailVos[type]["tongtj"] = obj.tongrj;
      }
      this.calculateHansl(type);
    },
    // 计算含水率
    calculateHansl(type) {
      const hejstzl = this.form.baDetailVos[type]["hejstzl"];
      const hejgtzl = this.form.baDetailVos[type]["hejgtzl"];
      let shifzl = "";
      let gantzl = "";
      let hansl = "";
      const hezl = this.form.baDetailVos[type]["hezl"];
      if (hejstzl & hejgtzl) {
        // 水分质量(g) = (盒+湿土质量(g)) -(盒+干土质量(g))
        shifzl = decimal.subtract(hejstzl, hejgtzl);
        if (hezl) {
          // 干土质量（g） = (盒+干土质量(g)) -(盒质量(g))
          gantzl = decimal.subtract(hejgtzl, hezl);
          // 含水率(%) = (水分质量(g)) -(干土质量（g）) * 100%
          hansl = decimal.divide(decimal.multiply(shifzl, 100), gantzl, 1);
        }
      }
      this.form.baDetailVos[type]["shifzl"] = shifzl;
      this.form.baDetailVos[type]["gantzl"] = gantzl;
      this.form.baDetailVos[type]["hansl"] = hansl;
      this.setHansl(type);
    },
    // 给cbr1传值含水率
    setHansl(index) {
      let newIndex = undefined;
      if (index % 2 == 1) {
        newIndex = (index - 1) / 2;
      } else {
        newIndex = index / 2;
      }
      const hansl1 = this.form.baDetailVos[index]["hansl"];
      const hansl2 = this.form.baDetailVos[index - 1]["hansl"];
      const info = {
        index: newIndex,
        hansl: calculateMeanvalue([hansl1, hansl2], 1)
      };
      Bus.$emit("cbrHanslChange", info);
    },
    // 汇总盒号
    collectHehId() {
      const arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8","9", "10", "11", "12", "13", "14", "15", "16", "17"];
      let hehIdList = [];
      arr.forEach((item) => {
        if (this.form.baDetailVos[item]["hehId"]) {
          hehIdList.push(this.form.baDetailVos[item]["hehId"]);
        }
      });
      this.form.hehIdList = hehIdList;
    },
    setTgCBRzdgmdPjz() {
      const info = {
        zuidgmd: this.form.zuidgmd,
        zuijhsl: this.form.zuijhsl
      };
      Bus.$emit("setTgCBRzdgmdPjz", info);
    },
    submitForm() {
      this.collectHehId();
      return this.form;
    },
    handleFocus(event) {
      // handleFocus(event, this.page, this.form[event]);
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]; // 每一行最多有多少可聚焦输入框（从0开始）
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]?.length) {
        this.$refs[ref][0].focus();
      } else if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    },
    handlePaste(event, rowIndex, colIndex) {
      const nameAllArr = [
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
        ["hezl", "hejstzl", "hejgtzl"],
      ];
      const methodsAllArr = [
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
        [null, "calculateHansl", "calculateHansl"],
      ];
      const parameterArr = [
        [null, "0", "0"],
        [null, "1", "1"],
        [null, "2", "2"],
        [null, "3", "3"],
        [null, "4", "4"],
        [null, "5", "5"],
        [null, "6", "6"],
        [null, "7", "7"],
        [null, "8", "8"],
        [null, "9", "9"],
        [null, "10", "10"],
        [null, "11", "11"],
        [null, "12", "12"],
        [null, "13", "13"],
        [null, "14", "14"],
        [null, "15", "15"],
        [null, "16", "16"],
        [null, "17", "17"],
      ];
      const subscriptArr = [
        [0, 0, 0],
        [1, 1, 1],
        [2, 2, 2],
        [3, 3, 3],
        [4, 4, 4],
        [5, 5, 5],
        [6, 6, 6],
        [7, 7, 7],
        [8, 8, 8],
        [9, 9, 9],
        [10, 10, 10],
        [11, 11, 11],
        [12, 12, 12],
        [13, 13, 13],
        [14, 14, 14],
        [15, 15, 15],
        [16, 16, 16],
        [17, 17, 17],
      ];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const {cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr} = data;

      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form.baDetailVos[subscriptSetArr[a][b]][nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          if (methodsSetArr[a][b] == null) {
          } else {
            this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
          }
        }
      }
    },
    // 计算方法调用
    setCalculate(name, a, b, c, d, e) {
      this[name](a, b, c, d, e);
    }
  }
};
</script>

<style scoped>
.td1 {
  width: calc(100% / 18 * 1);
}

.td2 {
  width: calc(100% / 18 * 2);
}

.td3 {
  width: calc(100% / 18 * 3);
}

.td4 {
  width: calc(100% / 18 * 4);
}

.td5 {
  width: calc(100% / 18 * 5);
}

.td9 {
  width: calc(100% / 18 * 9);
}
</style>
